#ifndef _DEFS_
#define _DEFS_

#include "params.h"

const uint	OUT		= 1<<31;

const int WHITE		= 16;
const int BLACK		= 32;
const int SIDE_MASK	= WHITE|BLACK;

#define IS_WHITE(a)	( (a) & WHITE )
#define IS_BLACK(a)	( (a) & BLACK )
#define IS_OUT(a)	( (a) & OUT )

const int PAWN		= 1;			//  pawn index
const int KNIGHT	= 2;			//  knight index
const int BISHOP	= 3;			//  bishop index
const int ROOK		= 4;			//  rook index
const int QUEEN		= 5;			//  queen index
const int KING		= 6;			//  king index

#define GET_PIECE_TYPE(pie) 	( ((pie)>>6) & ( 0x7 ) )
#define MOVE_OK(sq_pie,side)	( ! ( (sq_pie) & ( (side)|OUT ) ) )

const int MOVE_TYPE_KNIGHT	= 1;			//  move genarator knight moves
const int MOVE_TYPE_BISHOP	= 2;			//  move genarator bishop moves
const int MOVE_TYPE_ROOK	= 4;			//  move genarator rook moves

const BITBOARD 	KING_MOVES =
	conv_bitboard(
		b00000000,
		b00000000,
		b00000000,
		b00000000,
		b00000000,
		b11100000,
		b10100000,
		b11100000
	);
	
// board defines
const BITBOARD 	COL_A =
	conv_bitboard(
		b10000000,
		b10000000,
		b10000000,
		b10000000,
		b10000000,
		b10000000,
		b10000000,
		b10000000
	);
const BITBOARD 	COL_B = COL_A >> 1;
const BITBOARD 	COL_C = COL_B >> 1;
const BITBOARD 	COL_D = COL_C >> 1;
const BITBOARD 	COL_E = COL_D >> 1;
const BITBOARD 	COL_F = COL_E >> 1;
const BITBOARD 	COL_G = COL_F >> 1;
const BITBOARD 	COL_H = COL_G >> 1;

const BITBOARD 	ROW_1 =
	conv_bitboard(
		b00000000,
		b00000000,
		b00000000,
		b00000000,
		b00000000,
		b00000000,
		b00000000,
		b11111111
	);
const BITBOARD 	ROW_2 = ROW_1 << 8;
const BITBOARD 	ROW_3 = ROW_2 << 8;
const BITBOARD 	ROW_4 = ROW_3 << 8;
const BITBOARD 	ROW_5 = ROW_4 << 8;
const BITBOARD 	ROW_6 = ROW_5 << 8;
const BITBOARD 	ROW_7 = ROW_6 << 8;
const BITBOARD 	ROW_8 = ROW_7 << 8;


#endif
